package com.edu.his.controller;

import com.edu.his.domain.DrugInfo;
import com.edu.his.domain.MedicalRecord;
import com.edu.his.domain.Prescription;
import com.edu.his.service.DrugInfoService;
import com.edu.his.service.MedicalRecordService;
import com.edu.his.service.PrescriptionService;
import com.edu.his.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 描述：
 * 创建人：飘
 * 创建时间：2024/12/20
 **/
@RestController
@RequestMapping("/prescription")
@CrossOrigin(value = "*",maxAge = 3600)
public class PrescriptionController {

    @Autowired
    private PrescriptionService prescriptionService;
    @Autowired
    private DrugInfoService drugInfoService;

    @PostMapping("/insert")
    public R insert(@RequestBody List<Prescription> list) {
        return this.prescriptionService.insert(list);
    }

    @PostMapping("/selectdrug")
    public R selectDrug(@RequestBody DrugInfo drugInfo) {
        return this.drugInfoService.selectDrug(drugInfo);
    }
}
